Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body> <p id="p1" onmousedown="mouseDown()" onmouseup="mouseUp()"> Click the text! The mouseDown() function is triggered when the mouse button is pressed down over this paragraph. The function sets the color of the text to red. The mouseUp() function is triggered when the mouse button is released. The mouseUp() function sets the color of the text to green. </p> <script> function mouseDown() { document.getElementById("p1").style.color = "red"; } function mouseUp() { document.getElementById("p1").style.color = "green"; } </script> </body> <!-- Mirrored from www.w3schools.com/tags/tryit.asp?filename=tryhtml5_ev_onmousedown by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:09:15 GMT --> </html>
Result:
Try it Yourself - © w3schools.com